﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace Hsp.Auto.Model.Models
{
    /// <summary>
    /// 数据库连接配置
    /// </summary>
    [Table("DbConfigs")]
    public class DbConfigs
    {
        /// <summary>
        /// 数据库配置ID
        /// </summary>
        [DisplayName("ID")]
        public int Id { get; set; }

        /// <summary>
        /// 配置名称/连接名
        /// </summary>
        [DisplayName("连接名")]
        public string Name { get; set; }

        /// <summary>
        /// 数据库类型
        /// </summary>
        [DisplayName("数据库类型")]
        public string DBType { get; set; }

        /// <summary>
        /// 服务器地址
        /// </summary>
        [DisplayName("服务器地址")]
        public string Server { get; set; }

        /// <summary>
        /// 端口号
        /// </summary>
        [DisplayName("端口号")]
        public int? Port { get; set; }

        /// <summary>
        /// 数据库名称
        /// </summary>
        [DisplayName("数据库名称")]
        public string DBName { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        [DisplayName("账号")]
        public string Uid { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [DisplayName("密码")]
        public string Pwd { get; set; }

        //Id integer PRIMARY KEY autoincrement,
        //       Name nvarchar(200) unique,
        //      DBType varchar(30),
        //       Server varchar(100),
        //       Port integer,
        //       DBName varchar(100),
        //      Uid varchar(50),
        //       Pwd varchar(100),
        //        ConnTimeOut integer,
        //         ConnString text,
        //        Modified text

        /// <summary>
        /// 连接超时
        /// </summary>
        [DisplayName("连接超时")]
        public int? ConnTimeOut { get; set; }

        /// <summary>
        /// 连接字串
        /// </summary>
        [DisplayName("连接字串")]
        public string ConnString { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [DisplayName("修改时间")]
        public string Modified { get; set; }
    }
}
